import request from '@/utils/request'
const api_name = '/course'
export default {
    getList(page, limit, data) {
        return request({
            url: `${api_name}/list/${page}/${limit}`,
            method: 'post',
            data: data
        })
    },
    // 删除数据
    delById(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'delete'
        })
    },
    // 添加课程
    addCourse(data) {
        return request({
            url: `${api_name}`,
            method: 'post',
            data: data
        })
    },
    // 根据id来获取课程
    getCourse(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'get'
        })
    },
    // 修改课程信息
    updatecourse(course) {
        return request({
            url: `${api_name}/${course.id}`,
            method: 'put',
            data: course
        })
    }
}